#include<iostream>
using namespace std;
template<class T>class SeqStack{
private:
    T data[100];
    int top;//栈顶
public:
    SeqStack(){ top = -1; };
    //~SeqStack();
    int push2(T data);
    int push8(T data);
    int push16(T data);
    T pop();//出栈操作
};


template<class T> int SeqStack<T>::push2(T ele){
    int count = 0;
    while (ele != 0){
        top++;
        data[top] = ele % 2;
        ele = ele / 2;
        count++;
    }
    return count;
}
template<class T> int SeqStack<T>::push8(T ele){
    int count = 0;
    while (ele != 0){
        top++;
        data[top] = ele % 8;
        ele = ele / 8;
        count++;
    }
    return count;
}
template<class T> int SeqStack<T>::push16(T ele){
    int count = 0;
    while (ele != 0){
        top++;
        data[top] = ele % 16;
        ele = ele / 16;
        count++;
    }
    return count;
}
template<class T> T SeqStack<T>::pop(){
    if (top == -1) return false;

    return data[top--];
}
